{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2024-03-16T03:39:18.251056800Z",
     "start_time": "2024-03-16T03:39:18.080528800Z"
    }
   },
   "outputs": [],
   "source": [
    "# imports\n",
    "import os\n",
    "import json\n",
    "from app.constants import CONFIG"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [],
   "source": [
    "from app.classes import Dataset\n",
    "import pickle\n",
    "\n",
    "with open(f\"{CONFIG.dataset_folder}/commons-cli.pkl\", \"rb\") as f:\n",
    "    raw_dataset = pickle.load(f)\n",
    "    dataset = Dataset(**raw_dataset)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-16T07:53:27.801360900Z",
     "start_time": "2024-03-16T07:53:27.776079600Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [],
   "source": [
    "import tinydb\n",
    "from tinydb import Query\n",
    "db = tinydb.TinyDB(f\"commons-cli.json\")\n",
    "for class_info in dataset:\n",
    "    db.insert({\n",
    "        \"class_name\": class_info.class_name,\n",
    "        \"state\": False,\n",
    "    })\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-16T07:53:34.135593400Z",
     "start_time": "2024-03-16T07:53:33.988023700Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "outputs": [
    {
     "data": {
      "text/plain": "'StrBuilder#reverse'"
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-12T13:25:09.775892Z",
     "start_time": "2024-03-12T13:25:09.771566500Z"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
